package pe.intix.drawback.actions

import org.openxava.actions.*
import org.openxava.jpa.*
import org.openxava.util.*
import org.openxava.view.View

import pe.intix.drawback.model.*

/**
 * @author Jeromy Altuna
 *
 */
class BuscarDetalleComprobanteDesdeDetalleDeclaracionAction extends
		ReferenceSearchAction {
		
		@Override
		void execute() {
			super.execute()
			String idProveedor = getPreviousView().getParent()
								 .getValueString "proveedor.idProveedor"
			idProveedor = Is.emptyString(idProveedor)?"":idProveedor					 
			getTab().setBaseCondition """e_comprobantePago.class = ComprobanteCompra and 
						e_comprobantePago.proveedor.idProveedor = '${idProveedor}'"""
		}
}
